package com.designpatterns.observer.classto;

import com.designpatterns.observer.interfaceto.Observer;
import com.designpatterns.observer.interfaceto.Subject;

/**
 * 模拟第二个使用者
 */
public class ObserverUser2 implements Observer {
    @Override
    public void update(String msg) {
        System.out.println("----ObserverUser2得到3D号码"+msg +" 我要告诉舍友们");
    }


    public ObserverUser2(Subject subject) {
        subject.registerObserver(this);
    }
}
